<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="com.payment.taobaoNavigator.util.NavigatorCache"%>
<%@page import="com.payment.taobaoNavigator.entity.CatagoryEntity"%>
<%List<CatagoryEntity> catagoryEntitys = NavigatorCache.getByParentId(1); %>
<div id="leftBar">
			<div class="catalog">
				<span class="catalog_title"><a href="#">少儿读物<a></span><br>
				<span>
					<a href="#">幼儿教育</a> 
					<a href="#">小学一年级</a>
				</span>
				<div class="detail">
					<div>
						<a href="#">小学一年级</a>
						<a href="#">小学一年级</a>
						<a href="#">小学一年级</a>
						<a href="#">小学一年级</a>
						<a href="#">小学一年级</a>
					</div>
				</div>
			</div>
			<div class="catalog">
				<span class="catalog_title"><a href="#">少儿读物<a></span><br>
				<span>
					<a href="#">幼儿教育</a> 
					<a href="#">小学一年级</a>
				</span>
				<div class="detail">这里是详细信息</div>
			</div>
			<div class="catalog">
				<span class="catalog_title"><a href="#">特卖专区<a></span><br>
				<span>
					<a href="#">幼儿教育</a> 
					<a href="#">小学一年级</a>
				</span>
				<div class="detail">这里是详细信息</div>
			</div>
			<!-- 这里开始是展示侧栏的导航 -->
			<%
				for(CatagoryEntity entity : catagoryEntitys){
					%>
			<div class="catalog">
				<span class="catalog_title"><a href="#"><%=entity.getName() %><a></span><br>
				<span>
					<%
						List<CatagoryEntity> children = NavigatorCache.getByParentId(entity.getId());
						if(children.size() >= 2){
							for(int i = 0 ; i < 2 ; i++){
								%>
								<a href="javascript:showList(<%=children.get(i).getId() %>)"><%=children.get(i).getName() %></a> 
								<%
							}
						}else{
							for(int i = 0 ; i < children.size() ; i++){
								%>
								<a href="javascript:showList(<%=children.get(i).getId() %>)"><%=children.get(i).getName() %></a> 
								<%
							}
						}
					%>
				</span>
				<div class="detail">
					<div>
					<%
					for(int i = 2 ; i < children.size() ; i++){
						%>
						<a href="javascript:showList(<%=children.get(i).getId() %>)"><%=children.get(i).getName() %></a> 						
						<%
						if((i+4)%5==0){
							out.print("<br><br>");
						}
					}
					%>
					</div>
				</div>
			</div>
					<%
				}
			%>
			
		</div>